# coding:utf-8
'''
	粘贴模型模块
	汉中库得网络科技
	电子信箱：yyc1030@qq.com
'''
from PySide2 import QtGui
from PySide2 import QtWidgets
from pymxs import runtime as rt

class PasteModelAction(QtWidgets.QAction):
	
	def __init__(self, app):
		icon = QtGui.QIcon(app.rootPath + "/icon/paste_model.png")
		self.app = app
		super(PasteModelAction, self).__init__(icon, "粘贴模型", app.mainWindow)
		self.triggered.connect(self.pasteModel)
		
	def pasteModel(self):
		if rt.doesFileExist("C:/Users/Public/temp/diy_copy.max"):
			rt.mergeMaxFile("C:/Users/Public/temp/diy_copy.max", rt.name("select"), rt.name("AutoRenameDups"), rt.name("renameMtlDups"))